//
//  SecondViewController.m
//  27-Block
//
//  Created by dllo on 16/8/19.
//  Copyright © 2016年 DM.C. All rights reserved.
//

#import "SecondViewController.h"

@interface SecondViewController ()

@end

@implementation SecondViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"我是标题";
    self.view.backgroundColor = [UIColor redColor];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]
                                             initWithTitle:@"返回上一页"
                                             style:UIBarButtonItemStylePlain
                                             target:self
                                             action:@selector(goBack)];
    

}
- (void)goBack {
    if (self.passTitle) {
        self.passTitle(self.title);
        
        [self.navigationController popViewControllerAnimated:YES];
    }
    
}

- (void)dealloc {
    NSLog(@"SecondVC 被释放了");
    // MRC下的Block
    Block_release(_passTitle);
    _passTitle = nil;
    [super dealloc];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
